This README file contains instructions for replicating results reported in "Temperature variability implies greater economic damages from climate change" by Raphael Calel, Sandra C Chapman, David A Stainforth, and Nicholas W Watkins.


SOFTWARE AND HARDWARE:
R scripts were executed in R version 3.6.0. Matlab scripts were executed in Matlab version R2019a with the Financial Toolbox installed. All scripts were executed on Apple machines running MacOS Mojave version 10.14.5. Some commands and file path references may need to be modified for code to run on other machines.


DATA SOURCES:
The code calls data sets from three different sources.
- "HadCRUT.4.5.0.0.annual_ns_avg.txt": The HadCRUT historical time series for the global annual mean temperature anomaly was downloaded from the Met Office (https://www.metoffice.gov.uk/hadobs/hadcrut4/, URL date July 16, 2020). First column is year, second column is the annual mean temperature. We do not make use of data in any other columns.

- "das_CMIP5_rcp8_5.txt": The simulated temperature trajectories for RCP8.5 from CMIP5 was downloaded from the KNMI Climate Explorer ( https://climexp.knmi.nl/start.cgi, URL date July 16, 2020). The data are rebased to 1961-1990 average, to match HadCRUT. The top row gives the model name. The second row gives the initial condition member number. The remaining columns give global annual mean temperatures. We use models from columns 1, 21, and 41.

- "rf_rcp2_6.txt", "rf_rcp4_5.txt", "rf_rcp6_0.txt", and "rf_rcp8_5.txt": The radiative forcing time series associated with the different representative concentration pathways (RCPs) were downloaded from the Potsdam Institute for Climate Impact Research (http://www.pik-potsdam.de/%7Emmalte/rcps/index.htm#Download, URL date July 16, 2020).


REPLICATION INSTRUCTIONS:
Figure 1: Executing "figure1.R" in R will generate Figure 1. This script takes as input "HadCRUT.4.5.0.0.annual_ns_avg.txt" and "das_CMIP5_rcp8_5.txt".

Figure 2: Executing "figure2.R" in R will generate Figure 2. It takes as input temperature trajectories generated by executing "figure2.m" in Matlab. "figure2.m" takes "rf_rcp2_6.txt", "rf_rcp4_5.txt", "rf_rcp6_0.txt", or "rf_rcp8_5.txt" as an input, and must be executed once for each RCP (instructions in script). "figure2.m" also calls a function specified in "Hasselmann.m".

Figure 3: Executing "figure3.R" in R will generate Figure 3. It takes as input temperature trajectories generated by executing "figure3.m" in Matlab. "figure3.m" takes "rf_rcp2_6.txt", "rf_rcp4_5.txt", "rf_rcp6_0.txt", or "rf_rcp8_5.txt" as an input, and must be executed once for each RCP (instructions in script). "figure3.m" also calls a function specified in "Hasselmann.m".

SI Figure 1: Executing "SI_figure1.R" in R will generate Figure 1 from the SI.

SI Figure 2: Executing "SI_figure2.R" in R will generate Figure 2 from the SI. "SI_figure2.R" takes as input temperature trajectories generated by executing SI_figure2.m" in Matlab. "SI_figure2.m" takes "rf_rcp8_5.txt" as an input, and calls a function specified in "Hasselmann.m".

SI Figure 3: Executing "SI_figure3.R" in R will generate Figure 3 from the SI. "SI_figure3.R" takes as input temperature trajectories generated by executing "figure2.m" in Matlab, with options enabled for alternative parameter values (instructions in script).

SI Figure 4: Executing "SI_figure4.R" in R will generate Figure 4 from the SI.

SI Figure 5: Executing "SI_figure5.R" in R will generate Figure 5 from the SI.

SI Figure 6: Executing "SI_figure6.R" in R will generate Figure 6 from the SI.

SI Table 1: The numbers collected in table 1 in the SI are calculated by repeatedly executing "figure3.R" in R, with options enabled for alternative distributional assumptions for the Equilibrium Climate Sensitivity.

SI Table 2: The numbers collected in table 2 in the SI are calculated by repeatedly executing "figure2.R" in R, with options enabled for alternative assumptions for the pure rate of time preference, the coefficient of risk aversion, and for the rate of economic growth (instructions in script).

SI Section 9: First, executing "RCPplus.R" in R will generate modified RCP radiative forcing trajectories, as described in the SI. "RCPplus.R" takes "rf_rcp4_5.txt" as an input. Second, executing "RCPplus.m" in Matlab will generate temperature trajectories for the modified RCP4.5 radiative forcing trajectory. "RCPplus.m" takes the output from "RCPplus.R" as an input, and also calls a function specified in "Hasselmann.m". Third, "SCC.R" estimates the proportional change in the Social Cost of Carbon due to aleatory uncertainty. It takes as the output from "figure3.m" and "RCPplus.m" as inputs.
